// 设计报错按钮样式 (但跟删除按钮相比颜色反了过来,是白底红字)

// 关闭VSCode非必要报错
// ignore_for_file: camel_case_types, must_be_immutable, use_key_in_widget_constructors

import 'package:flutter/material.dart';
import 'package:yaru/yaru.dart';

class MyYaruButton_ErrorInfo extends StatelessWidget {
  // 设置需要传入的变量/函数
  final String text;
  VoidCallback onPressed;
  MyYaruButton_ErrorInfo({
    super.key,
    required this.text,
    required this.onPressed,
  });

  @override
  Widget build(BuildContext context) {
    return YaruOptionButton(
      autofocus: false,
      onPressed: onPressed,  // 设置按下时触发的函数   
      style: ButtonStyle(
        backgroundColor:WidgetStatePropertyAll(YaruColors.porcelain),   // 设置按钮背景颜色
      ),
      child: Text(
        text,
        style: TextStyle(
          color: YaruColors.adwaitaRed,
          fontSize: 18,
        ),
      ),
    );
  }
}
